
JSpec.describe('TableEditor', function() {
	before(function() {
		good_data_url = 'http://localhost/MetaCollection.ContentService/C/G'; // TODO: Find a better way to get this...
	});

	describe('new TableEditor(path)', function() {
		describe('valid path', function() {
			it('should be renderable', function() {
				te = new TableEditor(good_data_url);
				expect(te.isRenderable()).to(be_true);
			});
		});

		// describe('invalid path', function() {
			// it('should throw error', function() {
				// expect(new TableEditor('http://localhost/there_is_nothing_here')).to(throw_error);
			// });
		// });
	});
	
	describe('renderIntoElement(elementNameOrId)', function () {
		describe('valid element', function() {
			it('should return true', function() {
				te = new TableEditor(good_data_url);
				expect(te.renderIntoElement(new Element('body'))).to(be_true);
			});
		});
	});
});